
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     I N I T I A L I Z A T I O N   -   D O   N O T   M O D I F Y 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 G o s u b   I n i t A l l 
 
 S t o p 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     W O R K I N G   L O O P 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   L o o p 
 
 	 M o v e S l o w _ D e s t 1           =   4 0 0 
 
 	 M o v e S l o w _ D e s t 2           =   3 0 0 
 
 	 M o v e S l o w _ D e s t R o t 1     =   - 2 0 
 
 	 M o v e S l o w _ D e s t R o t 2     =   4 0 
 
 	 M o v e S l o w _ D e s t I n c h 1   =   - 1 0 
 
 	 M o v e S l o w _ D e s t I n c h 2   =   1 0 
 
 	 M o v e S l o w _ S p e e d           =   2 0 0 
 
 	 G o s u b   M o v e S l o w 
 
 	 W a i t   S e c o n d s   2 
 
 	 ' 
 
 	 M o v e S l o w _ D e s t 1           =   4 0 0 
 
 	 M o v e S l o w _ D e s t 2           =   3 0 0 
 
 	 M o v e S l o w _ D e s t R o t 1     =   2 0 
 
 	 M o v e S l o w _ D e s t R o t 2     =   2 0 
 
 	 M o v e S l o w _ D e s t I n c h 1   =   1 0 
 
 	 M o v e S l o w _ D e s t I n c h 2   =   - 1 0 
 
 	 M o v e S l o w _ S p e e d           =   2 0 0 
 
 	 G o s u b   M o v e S l o w 
 
 	 W a i t   S e c o n d s   2 
 
 	 ' 
 
 	 M o v e S l o w _ D e s t 1           =   5 7 0 
 
 	 M o v e S l o w _ D e s t 2           =   1 4 2 
 
 	 M o v e S l o w _ D e s t R o t 1     =   2 0 
 
 	 M o v e S l o w _ D e s t R o t 2     =   2 0 
 
 	 M o v e S l o w _ D e s t I n c h 1   =   0 
 
 	 M o v e S l o w _ D e s t I n c h 2   =   0 
 
 	 M o v e S l o w _ S p e e d           =   2 0 0 
 
 	 G o s u b   M o v e S l o w 
 
 	 W a i t   S e c o n d s   2 
 
 G o t o   L o o p 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     T E S T   F U N C T I O N S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   T e s t 1 
 
 	 M o v e S l o w _ D e s t 1           =   4 0 0 
 
 	 M o v e S l o w _ D e s t 2           =   2 5 0 
 
 	 M o v e S l o w _ D e s t R o t 1     =   2 5 
 
 	 M o v e S l o w _ D e s t R o t 2     =   3 5 
 
 	 M o v e S l o w _ D e s t I n c h 1   =   - 1 0 
 
 	 M o v e S l o w _ D e s t I n c h 2   =   1 0 
 
 	 M o v e S l o w _ S p e e d           =   3 0 0 
 
 	 G o s u b   M o v e S l o w 
 
 	 ' 
 
 	 M o v e S l o w _ D e s t 1           =   2 0 0 
 
 	 M o v e S l o w _ D e s t 2           =   5 0 0 
 
 	 M o v e S l o w _ D e s t R o t 1     =   3 5 
 
 	 M o v e S l o w _ D e s t R o t 2     =   2 5 
 
 	 M o v e S l o w _ D e s t I n c h 1   =   1 0 
 
 	 M o v e S l o w _ D e s t I n c h 2   =   - 1 0 
 
 	 M o v e S l o w _ S p e e d           =   3 0 0 
 
 	 G o s u b   M o v e S l o w 
 
 G o t o   T e s t 1 
 
 
 
 L a b e l   T e s t 2 
 
 	 
 
 R e t u r n 
 
 
 
 
 
 '   # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
 
 '     E N D   O F   U S E R   A R E A   -   D O   N O T   M O D I F Y   T H E   F O L L O W I N G   P A R T 
 
 '   # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
 
 
 
 L a b e l   I n i t A l l 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   E x e c u t i o n   s p e e d 
 
 	 O p t i o n   S p e e d   9 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   S p e e d   f o r   k e y b o a r d   J o g 
 
 	 K e y J o g _ S p e e d   =   2 0 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   S l o t s 
 
 	 S l o t M o t o r 1   =   1 
 
 	 S l o t M o t o r 2   =   3 
 
 	 S l o t S w i t c h S t a r t 1   =   5 
 
 	 S l o t S w i t c h S t a r t 2   =   6 
 
 	 S l o t S w i t c h E n d 1   =   7 
 
 	 S l o t S w i t c h E n d 2   =   8 
 
 	 S l o t M o t o r R o t 1   =   9 
 
 	 S l o t M o t o r I n c h 1   =   1 0 
 
 	 S l o t M o t o r R o t 2   =   1 1 
 
 	 S l o t M o t o r I n c h 2   =   1 2 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   L i m i t s   M i n   a n d   M a x 
 
 	 M o t 1 M i n   =   0 
 
 	 M o t 1 M a x   =   6 5 0 
 
 	 M o t 2 M i n   =   0 
 
 	 M o t 2 M a x   =   6 5 0 
 
 	 M o t 1 R o t M i n   =   - 9 0 
 
 	 M o t 1 R o t M a x   =   + 9 0 
 
 	 M o t 2 R o t M i n   =   - 9 0 
 
 	 M o t 2 R o t M a x   =   + 9 0 
 
 	 M o t 1 I n c h M i n   =   - 9 0 
 
 	 M o t 1 I n c h M a x   =   + 9 0 
 
 	 M o t 2 I n c h M i n   =   - 9 0 
 
 	 M o t 2 I n c h M a x   =   + 9 0 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   B u t t o n s 
 
 	 B u t t o n   1   T e x t   H O M E   M O T O R S 
 
 	 B u t t o n   2   T e x t   L o o p 
 
 	 
 
 	 B u t t o n   4   T e x t   T e s t 1 
 
 	 B u t t o n   5   T e x t   T e s t 2 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   I n i t   K e y s 
 
 	 G o s u b   I n i t K e y s 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   E n s u r e   m o t o r   s t o p p e d 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   R e s t o r e   o l d   m o t o r   p o s i t i o n s 
 
 	 G o s u b   R e s t o r e P o s i t i o n s 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   E v e n t u a l l y   d o   H O M E   M O T O R S   a n d   L O O P 
 
 	 ' G o s u b   H O M E   M O T O R S 
 
 	 ' G o s u b   L o o p 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     V A R S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   S l o t M o t o r 1 
 
 V a r i a b l e   N u m e r i c   S l o t M o t o r 2 
 
 V a r i a b l e   N u m e r i c   S l o t M o t o r R o t 1 
 
 V a r i a b l e   N u m e r i c   S l o t M o t o r R o t 2 
 
 V a r i a b l e   N u m e r i c   S l o t M o t o r I n c h 1 
 
 V a r i a b l e   N u m e r i c   S l o t M o t o r I n c h 2 
 
 V a r i a b l e   N u m e r i c   S l o t S w i t c h S t a r t 1 
 
 V a r i a b l e   N u m e r i c   S l o t S w i t c h E n d 1 
 
 V a r i a b l e   N u m e r i c   S l o t S w i t c h S t a r t 2 
 
 V a r i a b l e   N u m e r i c   S l o t S w i t c h E n d 2 
 
 
 
 V a r i a b l e   N u m e r i c   M o t 1 M i n 
 
 V a r i a b l e   N u m e r i c   M o t 1 M a x 
 
 V a r i a b l e   N u m e r i c   M o t 1 R o t M i n 
 
 V a r i a b l e   N u m e r i c   M o t 1 R o t M a x 
 
 V a r i a b l e   N u m e r i c   M o t 1 I n c h M i n 
 
 V a r i a b l e   N u m e r i c   M o t 1 I n c h M a x 
 
 
 
 V a r i a b l e   N u m e r i c   M o t 2 M i n 
 
 V a r i a b l e   N u m e r i c   M o t 2 M a x 
 
 V a r i a b l e   N u m e r i c   M o t 2 R o t M i n 
 
 V a r i a b l e   N u m e r i c   M o t 2 R o t M a x 
 
 V a r i a b l e   N u m e r i c   M o t 2 I n c h M i n 
 
 V a r i a b l e   N u m e r i c   M o t 2 I n c h M a x 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '   E N A B L E / D I S A B L E   B U T T O N S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   E n a b l e A l l B u t t o n s 
 
 	 F o r   v 1   =   1   T o   3 2 
 
 	 	 B u t t o n   v 1   E n a b l e d 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 L a b e l   D i s a b l e A l l B u t t o n s 
 
 	 F o r   v 1   =   1   T o   3 2 
 
 	 	 B u t t o n   v 1   D i s a b l e d 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     C L O S I N G   E V E N T S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   E v e n t S t o p 
 
 	 G o s u b   S a v e P o s i t i o n s 
 
 	 G o s u b   E n a b l e A l l B u t t o n s 
 
 E n d 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     S A V E   a n d   R E S T O R E   P O S I T I O N S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   S a v e P o s i t i o n s 
 
 	 v 1   =   S l o t ( S l o t M o t o r 1 ) 
 
 	 v 2   =   S l o t ( S l o t M o t o r 2 ) 
 
 	 v 3   =   S l o t ( S l o t M o t o r R o t 1 ) 
 
 	 v 4   =   S l o t ( S l o t M o t o r R o t 2 ) 
 
 	 S a v e   V a r s 
 
 R e t u r n 
 
 
 
 L a b e l   R e s t o r e P o s i t i o n s 
 
 	 L o a d   V a r s 
 
 	 I f   v 1   < >   0   A n d   v 2   < >   0   A n d   v 3   < >   0   A n d   v 4   =   0 
 
 	 	 S l o t ( S l o t M o t o r 1 )   =   R e s e t 
 
 	 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 	 S l o t ( S l o t M o t o r 1 )   =   v 1 
 
 	 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 	 ' 
 
 	 	 S l o t ( S l o t M o t o r 2 )   =   R e s e t 
 
 	 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 	 S l o t ( S l o t M o t o r 2 )   =   v 2 
 
 	 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 	 ' 
 
 	 	 S l o t ( S l o t M o t o r R o t 1 )   =   R e s e t 
 
 	 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 	 S l o t ( S l o t M o t o r R o t 1 )   =   v 3 
 
 	 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 	 ' 
 
 	 	 S l o t ( S l o t M o t o r R o t 2 )   =   R e s e t 
 
 	 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 	 S l o t ( S l o t M o t o r R o t 2 )   =   v 4 
 
 	 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 E n d I f 
 
 	 G o s u b   P r i n t V a l u e s 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     M O V E   S L O W   X Y 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   M o v e S l o w _ D e s t 1   	   '   d e s t i n a t i o n   i n   m m 
 
 V a r i a b l e   N u m e r i c   M o v e S l o w _ D e s t 2   	   '   d e s t i n a t i o n   i n   m m 
 
 V a r i a b l e   N u m e r i c   M o v e S l o w _ D e s t R o t 1       '   d e s t i n a t i o n   i n   m m 
 
 V a r i a b l e   N u m e r i c   M o v e S l o w _ D e s t R o t 2       '   d e s t i n a t i o n   i n   m m 
 
 V a r i a b l e   N u m e r i c   M o v e S l o w _ D e s t I n c h 1     '   d e s t i n a t i o n   i n   m m 
 
 V a r i a b l e   N u m e r i c   M o v e S l o w _ D e s t I n c h 2     '   d e s t i n a t i o n   i n   m m 
 
 V a r i a b l e   N u m e r i c   M o v e S l o w _ S p e e d   	   '   s p e e d   i n   m m / s e c 
 
 
 
 V a r i a b l e   N u m e r i c   M S V 1 
 
 V a r i a b l e   N u m e r i c   M S V 2 
 
 V a r i a b l e   N u m e r i c   M S V R 1 
 
 V a r i a b l e   N u m e r i c   M S V R 2 
 
 V a r i a b l e   N u m e r i c   M S V I 1 
 
 V a r i a b l e   N u m e r i c   M S V I 2 
 
 V a r i a b l e   N u m e r i c   M S V 7 
 
 V a r i a b l e   N u m e r i c   M S V 8 
 
 
 
 L a b e l   M o v e S l o w 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   t e s t   f o r   o u t   o f   l i m i t 
 
 	 S l o t ( S l o t M o t o r 1 )   =   L i m i t ( S l o t ( S l o t M o t o r 1 ) ,   M o t 1 M i n ,   M o t 1 M a x ) 
 
 	 S l o t ( S l o t M o t o r 2 )   =   L i m i t ( S l o t ( S l o t M o t o r 2 ) ,   M o t 2 M i n ,   M o t 2 M a x ) 
 
 	 S l o t ( S l o t M o t o r R o t 1 )   =   L i m i t ( S l o t ( S l o t M o t o r R o t 1 ) ,   M o t 1 R o t M i n ,   M o t 1 R o t M a x ) 
 
 	 S l o t ( S l o t M o t o r R o t 2 )   =   L i m i t ( S l o t ( S l o t M o t o r R o t 2 ) ,   M o t 2 R o t M i n ,   M o t 2 R o t M a x ) 
 
 	 S l o t ( S l o t M o t o r I n c h 1 )   =   L i m i t ( S l o t ( S l o t M o t o r I n c h 1 ) ,   M o t 1 I n c h M i n ,   M o t 1 I n c h M a x ) 
 
 	 S l o t ( S l o t M o t o r I n c h 2 )   =   L i m i t ( S l o t ( S l o t M o t o r I n c h 2 ) ,   M o t 2 I n c h M i n ,   M o t 2 I n c h M a x ) 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   t e s t   f o r   v e r y   l o w   s p e e d 
 
 	 I f   M o v e S l o w _ S p e e d   <   0 . 1 
 
 	 	 M o v e S l o w _ S p e e d   =   1 
 
 	 E n d I f 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   c a l c   t h e   m o v e m e n t   i n   m m 
 
 	 M S V 1   =   M o v e S l o w _ D e s t 1   -   S l o t ( S l o t M o t o r 1 ) 
 
 	 M S V 2   =   M o v e S l o w _ D e s t 2   -   S l o t ( S l o t M o t o r 2 ) 
 
 	 M S V R 1   =   M o v e S l o w _ D e s t R o t 1   -   S l o t ( S l o t M o t o r R o t 1 ) 
 
 	 M S V R 2   =   M o v e S l o w _ D e s t R o t 2   -   S l o t ( S l o t M o t o r R o t 2 ) 
 
 	 M S V I 1   =   M o v e S l o w _ D e s t I n c h 1   -   S l o t ( S l o t M o t o r I n c h 1 ) 
 
 	 M S V I 2   =   M o v e S l o w _ D e s t I n c h 2   -   S l o t ( S l o t M o t o r I n c h 2 ) 
 
 	 
 
 	 M S V 7   =   M S V 1   *   M S V 1 
 
 	 M S V 7   =   M S V 7   +   M S V 2   *   M S V 2 
 
 	 M S V 7   =   M S V 7   +   M S V R 1   *   M S V R 1 
 
 	 M S V 7   =   M S V 7   +   M S V R 2   *   M S V R 2 
 
 	 M S V 7   =   M S V 7   +   M S V I 1   *   M S V I 1 
 
 	 M S V 7   =   M S V 7   +   M S V I 2   *   M S V I 2 
 
 	 M S V 7   =   S q r t ( M S V 7 ) 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   c a l c   t h e   l o o p s   c o u n t 
 
 	 M S V 8   =   M S V 7   /   0 . 0 1   ' < < <   l o o p   t i m e 
 
 	 M S V 8   =   I n t ( M S V 8   /   M o v e S l o w _ S p e e d ) 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   t o o   m u c h   s p e e d   ? 
 
 	 I f   M S V 8   =   0 
 
 	 	 S l o t ( S l o t M o t o r 1 )   =   L i m i t ( M o v e S l o w _ D e s t 1 ,   M o t 1 M i n ,   M o t 1 M a x ) 
 
 	 	 S l o t ( S l o t M o t o r 2 )   =   L i m i t ( M o v e S l o w _ D e s t 2 ,   M o t 2 M i n ,   M o t 2 M a x ) 
 
 	 	 S l o t ( S l o t M o t o r R o t 1 )   =   L i m i t ( M o v e S l o w _ D e s t R o t 1 ,   M o t 1 R o t M i n ,   M o t 1 R o t M a x ) 
 
 	 	 S l o t ( S l o t M o t o r R o t 2 )   =   L i m i t ( M o v e S l o w _ D e s t R o t 2 ,   M o t 2 R o t M i n ,   M o t 2 R o t M a x ) 
 
 	 	 S l o t ( S l o t M o t o r I n c h 1 )   =   L i m i t ( M o v e S l o w _ D e s t I n c h 1 ,   M o t 1 I n c h M i n ,   M o t 1 I n c h M a x ) 
 
 	 	 S l o t ( S l o t M o t o r I n c h 2 )   =   L i m i t ( M o v e S l o w _ D e s t I n c h 2 ,   M o t 2 I n c h M i n ,   M o t 2 I n c h M a x ) 
 
 	 	 R e t u r n 
 
 	 E n d I f 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   p r e p a r e   t h e   i n c r e m e n t s 
 
 	 M S V 1   =   ( M o v e S l o w _ D e s t 1   -   S l o t ( S l o t M o t o r 1 ) )   /   M S V 8 
 
 	 M S V 2   =   ( M o v e S l o w _ D e s t 2   -   S l o t ( S l o t M o t o r 2 ) )   /   M S V 8 
 
 	 M S V R 1   =   ( M o v e S l o w _ D e s t R o t 1   -   S l o t ( S l o t M o t o r R o t 1 ) )   /   M S V 8 
 
 	 M S V R 2   =   ( M o v e S l o w _ D e s t R o t 2   -   S l o t ( S l o t M o t o r R o t 2 ) )   /   M S V 8 
 
 	 M S V I 1   =   ( M o v e S l o w _ D e s t I n c h 1   -   S l o t ( S l o t M o t o r I n c h 1 ) )   /   M S V 8 
 
 	 M S V I 2   =   ( M o v e S l o w _ D e s t I n c h 2   -   S l o t ( S l o t M o t o r I n c h 2 ) )   /   M S V 8 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   l o o p   f o r   M S V 6   t i m e s 
 
 	 F o r   M S V 7   =   1   T o   M S V 8 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   i n c r e m e n t ,   m o v e   a n d   w a i t 
 
 	 	 S l o t ( S l o t M o t o r 1 )   =   L i m i t ( S l o t ( S l o t M o t o r 1 )   +   M S V 1 ,   M o t 1 M i n ,   M o t 1 M a x ) 
 
 	 	 S l o t ( S l o t M o t o r 2 )   =   L i m i t ( S l o t ( S l o t M o t o r 2 )   +   M S V 2 ,   M o t 2 M i n ,   M o t 2 M a x ) 
 
 	 	 S l o t ( S l o t M o t o r R o t 1 )   =   L i m i t ( S l o t ( S l o t M o t o r R o t 1 )   +   M S V R 1 ,   M o t 1 R o t M i n ,   M o t 1 R o t M a x ) 
 
 	 	 S l o t ( S l o t M o t o r R o t 2 )   =   L i m i t ( S l o t ( S l o t M o t o r R o t 2 )   +   M S V R 2 ,   M o t 2 R o t M i n ,   M o t 2 R o t M a x ) 
 
 	 	 S l o t ( S l o t M o t o r I n c h 1 )   =   L i m i t ( S l o t ( S l o t M o t o r I n c h 1 )   +   M S V I 1 ,   M o t 1 I n c h M i n ,   M o t 1 I n c h M a x ) 
 
 	 	 S l o t ( S l o t M o t o r I n c h 2 )   =   L i m i t ( S l o t ( S l o t M o t o r I n c h 2 )   +   M S V I 2 ,   M o t 2 I n c h M i n ,   M o t 2 I n c h M a x ) 
 
 	 	 W a i t   S e c o n d s   0 . 0 1   ' < < <   l o o p   t i m e 
 
 	 	 G o s u b   P r i n t V a l u e s 
 
 	 N e x t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     H O M E   M O T O R S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   H O M E   M O T O R S 
 
 	 S l o t M o t o r   =   S l o t M o t o r 1 
 
 	 S l o t S e n s o r   =   S l o t S w i t c h S t a r t 1 
 
 	 S p e e d S e a r c h   =   - 0 . 2 5           '   s e a r c h   d i r e c t i o n   a n d   s p e e d 
 
 	 S p e e d R e t u r n   =   + 0 . 0 5           '   r e t u r n   d i r e c t i o n   a n d   s p e e d 
 
 	 D e c l a r e d S w i t c h P o s   =   0 
 
 	 I n i t i a l P o s i t i o n   =   5 	 	 '   r e l a t i v e   t o   D e c l a r e d S w i t c h P o s 
 
 	 G o s u b   H o m e M o t o r 
 
 	 ' 
 
 	 S l o t M o t o r   =   S l o t M o t o r 2 
 
 	 S l o t S e n s o r   =   S l o t S w i t c h S t a r t 2 
 
 	 S p e e d S e a r c h   =   - 0 . 2 5 	 	 '   s e a r c h   d i r e c t i o n   a n d   s p e e d 
 
 	 S p e e d R e t u r n   =   + 0 . 0 5 	 	 '   r e t u r n d i r e c t i o n   a n d   s p e e d 
 
 	 D e c l a r e d S w i t c h P o s   =   0 
 
 	 I n i t i a l P o s i t i o n   =   5 	 	 '   r e l a t i v e   t o   D e c l a r e d S w i t c h P o s 
 
 	 G o s u b   H o m e M o t o r 
 
 	 ' 
 
 	 G o s u b   P r i n t V a l u e s 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     H o m e   t h e   M o t o r ( S l o t M o t o r )   t o   t h e   S e n s o r ( S l o t S e n s o r ) 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   S l o t M o t o r 
 
 V a r i a b l e   N u m e r i c   S l o t S e n s o r 
 
 V a r i a b l e   N u m e r i c   S p e e d S e a r c h 
 
 V a r i a b l e   N u m e r i c   S p e e d R e t u r n 
 
 V a r i a b l e   N u m e r i c   D e c l a r e d S w i t c h P o s 
 
 V a r i a b l e   N u m e r i c   I n i t i a l P o s i t i o n 
 
 
 
 L a b e l   H o m e M o t o r 
 
 	 G o s u b   D i s a b l e A l l B u t t o n s 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - -   d e t a c h   i f   s e n s o r   i s   a c t i v e 
 
 	 I f   S l o t ( S l o t S e n s o r )   >   5 0 0   O r   K e y ( " C T R L " ) 
 
 	 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d R e t u r n 
 
 	 E n d I f 
 
         '   - - - - - - - - - - - - - - - - - - - - - - - - -   s e a r c h   t h e   s e n s o r 
 
 L a b e l   S e a r c h H o m e 
 
 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d S e a r c h 
 
 	 W a i t   S e c o n d s   0 . 0 0 1 
 
 	 I f   S l o t ( S l o t S e n s o r )   >   5 0 0   O r   K e y ( " C T R L " ) 
 
 	 	 S l o t ( S l o t M o t o r )   =   R e s e t 
 
 	 	 W a i t   S e c o n d s   0 . 1 
 
 	 	 S l o t ( S l o t M o t o r )   =   0 
 
 	 	 W a i t   S e c o n d s   0 . 1 
 
 	 	 G o t o   D e t a c h S e n s o r 
 
 	 E n d I f 
 
 G o t o   S e a r c h H o m e 
 
         '   - - - - - - - - - - - - - - - - - - - - - - - - -   d e t a c h   f r o m   t h e   s e n s o r 
 
 L a b e l   D e t a c h S e n s o r 
 
 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d R e t u r n 
 
 	 W a i t   S e c o n d s   0 . 0 0 1 
 
 	 I f   S l o t   ( S l o t S e n s o r )   <   5 0 0 
 
 	 	 S l o t ( S l o t M o t o r )   =   R e s e t 
 
 	 	 W a i t   S e c o n d s   0 . 1 
 
 	 	 S l o t ( S l o t M o t o r )   =   D e c l a r e d S w i t c h P o s 
 
 	 	 W a i t   S e c o n d s   0 . 1 
 
 	 	 G o t o   S e t F i n a l V a l u e s 
 
 	 E n d I f 
 
 G o t o   D e t a c h S e n s o r 
 
         '   - - - - - - - - - - - - - - - - - - - - - - - - -   r e s e t   a n d   m o v e   t o   I n i t i a l P o s 
 
 L a b e l   S e t F i n a l V a l u e s 
 
 	 S l o t ( S l o t M o t o r )   =   I n i t i a l P o s i t i o n 
 
 	 G o s u b   W a i t M o t o r 
 
 	 G o s u b   E n a b l e A l l B u t t o n s 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '       W a i t   u n t i l   t h e   m o t o r ( S l o t M o t o r )   i s   s t o p p e d 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   W a i t M o t o r 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 	 V a r i a b l e   N u m e r i c   W a i t M o t 1 
 
 	 F o r   W a i t M o t 1   =   1   T o   9 e 9 9 
 
 	 	 I f   A b s ( S l o t ( S l o t M o t o r   +   1 ) )   <   0 . 0 1 
 
 	 	 	 E x i t 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 0 0 5 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '       W a i t   u n t i l   A l l - M o t o r s   a r e   s t o p p e d 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   W a i t A l l M o t o r s 
 
 	 W a i t   S e c o n d s   0 . 1   '   < < <   e n s u r e s   t h a t   m o t o r s   a r e   r e a l l y   s t a r t e d 
 
 	 V a r i a b l e   N u m e r i c   W a i t M o t 2 
 
 	 F o r   W a i t M o t 2   =   1   T o   9 e 9 9 
 
 	 	 I f   A b s ( S l o t ( S l o t M o t o r 1   +   1 ) )   <   0 . 0 1   A n d   A b s ( S l o t ( S l o t M o t o r 2   +   1 ) )   <   0 . 0 1 
 
 	 	 	 E x i t 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 0 0 5 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     I N I T   K E Y S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   I n i t K e y s 
 
 	 K e y   Q 	 G o s u b   E x e c K e y s 
 
 	 K e y   A   	 G o s u b   E x e c K e y s 
 
 	 K e y   W   	 G o s u b   E x e c K e y s 
 
 	 K e y   S   	 G o s u b   E x e c K e y s 
 
 	 K e y   E   	 G o s u b   E x e c K e y s 
 
 	 K e y   D   	 G o s u b   E x e c K e y s 
 
 	 K e y   R 	 G o s u b   E x e c K e y s 
 
 	 K e y   F   	 G o s u b   E x e c K e y s 
 
 	 K e y   T   	 G o s u b   E x e c K e y s 
 
 	 K e y   G   	 G o s u b   E x e c K e y s 
 
 	 K e y   Y   	 G o s u b   E x e c K e y s 
 
 	 K e y   H   	 G o s u b   E x e c K e y s 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     J O G   w i t h   k e y b o a r d 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   E x e c K e y s 
 
 	 V a r i a b l e   N u m e r i c   K e y J o g _ S p e e d 
 
 	 V a r i a b l e   N u m e r i c   J o g S p e e d 
 
 	 J o g S p e e d   =   K e y J o g _ S p e e d   /   1 0 0 
 
 	 S e l e c t   T r u e 
 
 	 	 C a s e   K e y ( " S H I F T " ) 
 
 	 	 	 J o g S p e e d   =   J o g S p e e d   *   1 0 0 
 
 	 	 C a s e   K e y ( " C T R L " ) 
 
 	 	 	 J o g S p e e d   =   J o g S p e e d   *   1 0 
 
 	 	 C a s e   K e y ( " A L T " ) 
 
 	 	 	 J o g S p e e d   =   J o g S p e e d   *   0 . 1 
 
 	 E n d S e l e c t 
 
 	 ' 
 
 	 I f   K e y ( " Q " ) 
 
 	 	 S l o t   S l o t M o t o r 1   =   L i m i t ( S l o t ( S l o t M o t o r 1 )   +   J o g S p e e d ,   M o t 1 M i n ,   M o t 1 M a x ) 
 
 	 E n d I f 
 
 	 I f   K e y ( " A " ) 
 
 	 	 S l o t   S l o t M o t o r 1   =   L i m i t ( S l o t ( S l o t M o t o r 1 )   -   J o g S p e e d ,   M o t 1 M i n ,   M o t 1 M a x ) 
 
 	 E n d I f 
 
 	 ' 
 
 	 I f   K e y ( " W " ) 
 
 	 	 S l o t   S l o t M o t o r 2   =   L i m i t ( S l o t ( S l o t M o t o r 2 )   +   J o g S p e e d ,   M o t 2 M i n ,   M o t 2 M a x ) 
 
 	 E n d I f 
 
 	 I f   K e y ( " S " ) 
 
 	 	 S l o t   S l o t M o t o r 2   =   L i m i t ( S l o t ( S l o t M o t o r 2 )   -   J o g S p e e d ,   M o t 2 M i n ,   M o t 2 M a x ) 
 
 	 E n d I f 
 
 	 ' 
 
 	 I f   K e y ( " E " ) 
 
 	 	 S l o t   S l o t M o t o r R o t 1   =   L i m i t ( S l o t ( S l o t M o t o r R o t 1 )   +   J o g S p e e d ,   M o t 1 R o t M i n ,   M o t 1 R o t M a x ) 
 
 	 E n d I f 
 
 	 I f   K e y ( " D " ) 
 
 	 	 S l o t   S l o t M o t o r R o t 1   =   L i m i t ( S l o t ( S l o t M o t o r R o t 1 )   -   J o g S p e e d ,   M o t 1 R o t M i n ,   M o t 1 R o t M a x ) 
 
 	 E n d I f 
 
 	 ' 
 
 	 I f   K e y ( " R " ) 
 
 	 	 S l o t   S l o t M o t o r R o t 2   =   L i m i t ( S l o t ( S l o t M o t o r R o t 2 )   +   J o g S p e e d ,   M o t 2 R o t M i n ,   M o t 2 R o t M a x ) 
 
 	 E n d I f 
 
 	 I f   K e y ( " F " ) 
 
 	 	 S l o t   S l o t M o t o r R o t 2   =   L i m i t ( S l o t ( S l o t M o t o r R o t 2 )   -   J o g S p e e d ,   M o t 2 R o t M i n ,   M o t 2 R o t M a x ) 
 
 	 E n d I f 
 
 	 	 ' 
 
 	 I f   K e y ( " T " ) 
 
 	 	 S l o t   S l o t M o t o r I n c h 1   =   L i m i t ( S l o t ( S l o t M o t o r I n c h 1 )   +   J o g S p e e d ,   M o t 1 I n c h M i n ,   M o t 1 I n c h M a x ) 
 
 	 E n d I f 
 
 	 I f   K e y ( " G " ) 
 
 	 	 S l o t   S l o t M o t o r I n c h 1   =   L i m i t ( S l o t ( S l o t M o t o r I n c h 1 )   -   J o g S p e e d ,   M o t 1 I n c h M i n ,   M o t 1 I n c h M a x ) 
 
 	 E n d I f 
 
 	 ' 
 
 	 I f   K e y ( " Y " ) 
 
 	 	 S l o t   S l o t M o t o r I n c h 2   =   L i m i t ( S l o t ( S l o t M o t o r I n c h 2 )   +   J o g S p e e d ,   M o t 2 I n c h M i n ,   M o t 2 I n c h M a x ) 
 
 	 E n d I f 
 
 	 I f   K e y ( " H " ) 
 
 	 	 S l o t   S l o t M o t o r I n c h 2   =   L i m i t ( S l o t ( S l o t M o t o r I n c h 2 )   -   J o g S p e e d ,   M o t 1 I n c h M i n ,   M o t 2 I n c h M a x ) 
 
 	 E n d I f 
 
 	 ' 
 
 	 G o s u b   P r i n t V a l u e s 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     P R I N T   V A L U E S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   P r i n t V a l u e s 
 
 	 s 1   =             " M o t o r 1 = "   +   F o r m a t ( S l o t ( S l o t M o t o r 1 ) ,   " 0 . 0 " ) 
 
 	 s 1   =   s 1   +   "       M o t o r R o t 1 = "   +   F o r m a t ( S l o t ( S l o t M o t o r R o t 1 ) ,   " 0 . 0 " ) 
 
 	 s 1   =   s 1   +   "       M o t o r I n c h 1 = "   +   F o r m a t ( S l o t ( S l o t M o t o r I n c h 1 ) ,   " 0 . 0 " )   +   C R L F 
 
 	 s 1   =   s 1   +   " M o t o r 2 = "   +   F o r m a t ( S l o t ( S l o t M o t o r 2 ) ,   " 0 . 0 " ) 
 
 	 s 1   =   s 1   +   "       M o t o r R o t 2 = "   +   F o r m a t ( S l o t ( S l o t M o t o r R o t 2 ) ,   " 0 . 0 " ) 
 
 	 s 1   =   s 1   +   "       M o t o r I n c h 2 = "   +   F o r m a t ( S l o t ( S l o t M o t o r I n c h 2 ) ,   " 0 . 0 " ) 
 
 	 P r i n t   s 1 
 
 R e t u r n 
 
 
 
 
 
 ' W A T C H   S p e e d 
 
 ' W A T C H   W a i t   S e c o n d s   2 
 
 ' W A T C H   W a i t   S e c o n d s   2 
 
 ' W A T C H   W a i t   S e c o n d s   2 
 
 ' W A T C H   W a i t   S e c o n d s   2 
 
 ' W A T C H   W a i t   S e c o n d s   2 
 
 ' E X E C   S l o t ( 2 )   =   0 
 
 